package com.lijiaxing.controller;

import com.lijiaxing.pojo.Companio;
import com.lijiaxing.pojo.Result;
import com.lijiaxing.service.staffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.File;

@RestController
@RequestMapping("/companio")
public class staffController {
    @Autowired
    staffService ss;
    @GetMapping("/list")
    public Result getCompanioList(@RequestParam("pageNum") int pageNum, @RequestParam("pageSize") int pageSize){
           return Result.success(ss.getCompanioList(pageNum,pageSize),"OK");
    }
    @PostMapping("/add")
    public void addCompanio( String name , File avatar,String sex,Integer age,String tel,Boolean active){
        System.out.println(new Companio(null,name,tel,sex,age,null,active?1:0,avatar.getName()));
    }
}
